// 基于template/src/widgets/{{appEntities}}/{{ctrls@TREEVIEW}}-tree/{{spinalCase ctrl.codeName}}-tree-model.ts.hbs生成
import { ITreeModel, ITreeNodeModel, ITreeNodeRsModel } from "@/core";

function getModel(): ITreeModel {
    return {
        name: "treeexpbar_tree",
        caption: "",
        codeName: "Tree04",
        cssName: "",
        controlType: "TREEVIEW",
        entityCodeName: "IBIZSample0003",
        ctrlMsgModel:[
    ],
        rootVisible: false,
        treeNodes: getTreeNodes(),
        treeNodeRSs: getTreeNodeRSs(),
    }
}

function getTreeNodes(): ITreeNodeModel[] {
    return [
            {
                id: "root",
                treeNodeType: "STATIC",
                allowDrag: false,
                allowDrop: false,
                allowEditText: false,
                allowOrder: false,
                enableCheck: false,
                disableSelect: false,
                expanded: false,
                cssName: "",
                leaf: false,
                selected: false,
                navFilter: "",
                appendPNodeId: false,
                counterId: "",
                counterMode: 0,
                nodeType: "root",
                rootNode: true,
                selectFirstOnly: false,
                expandFirstOnly: false,
                enableQuickSearch: false,
                text: "root",
                tooltip: "",
                nodeValue: "root",
                navigateContext: {  },
                navigateParams: {  },
            },
            {
                id: "curdata",
                treeNodeType: "DE",
                allowDrag: false,
                allowDrop: false,
                allowEditText: false,
                allowOrder: false,
                enableCheck: false,
                disableSelect: false,
                expanded: false,
                cssName: "",
                leaf: false,
                selected: false,
                navFilter: "",
                appendPNodeId: false,
                counterId: "",
                counterMode: 0,
                nodeType: "curdata",
                rootNode: false,
                selectFirstOnly: false,
                expandFirstOnly: false,
                enableQuickSearch: false,
                cssClass: "fa fa-toggle-up",
                entityCodeName: "IBIZSample0003",
                controlVoName: "CurdataControlVO",
                keyPSAppDEField: "IBIZSAMPLE0003Id",
                majorPSAppDEField: "IBIZSAMPLE0003Name",
                appDeDataSet: "FetchCurData",
                navViewName: "IBIZSample0003GridView",
                navigateContext: {  },
                navigateParams: { 'n_pibizsample0003id_eq':'%nodeid%' },
            },
            {
                id: "topdata",
                treeNodeType: "DE",
                allowDrag: false,
                allowDrop: false,
                allowEditText: false,
                allowOrder: false,
                enableCheck: false,
                disableSelect: false,
                expanded: false,
                cssName: "",
                leaf: false,
                selected: false,
                navFilter: "",
                appendPNodeId: false,
                counterId: "",
                counterMode: 0,
                nodeType: "topdata",
                rootNode: false,
                selectFirstOnly: false,
                expandFirstOnly: false,
                enableQuickSearch: false,
                cssClass: "fa fa-list-ul",
                entityCodeName: "IBIZSample0003",
                controlVoName: "TopdataControlVO",
                keyPSAppDEField: "IBIZSAMPLE0003Id",
                majorPSAppDEField: "IBIZSAMPLE0003Name",
                appDeDataSet: "FetchTopData",
                navViewName: "IBIZSample0003GridView",
                navigateContext: { 'contextparam1':'%memo%' },
                navigateParams: { 'memo':'%memo%','n_pibizsample0003id_eq':'%nodeid%' },
                contextMenus: [
                        {
                            name: "deuiaction1",
                            ctrlname: "topdata_cm",
                            nodeOwner: "topdata",
                            caption: "刷新全部",
                            showCaption: true,
                            showIcon: true,
                            tooltip: "刷新全部",
                            uiAction: {
                                actionTag: "RefreshAll",	
                                actionTarget: "",
                                dataAccessAction: "",
                                noPrivDisplayMode: 2,
                                visible: true,
                                disabled: false,            
                                uIActionMode: "SYS",
                                uIActionType: "DEUIACTION",
                                actionDECodeName: "IBIZSample0003",
                                predefinedType: "TREEVIEW_REFRESHALLACTION",            
                            },        
                            cssClass: "fa fa-refresh",
                        }
                ],
            }
    ]
}

function getTreeNodeRSs(): ITreeNodeRsModel[] {
    return [
            {
                childDeTreeNodeId: "curdata",
                parentPSDETreeNodeId: "curdata",
                parentValueLevel: 1,
                searchMode: 3,
                navigateContext: {  },
                navigateParams: {  },
            },
            {
                childDeTreeNodeId: "curdata",
                parentPSDETreeNodeId: "topdata",
                parentValueLevel: 1,
                searchMode: 3,
                navigateContext: {  },
                navigateParams: {  },
            },
            {
                childDeTreeNodeId: "topdata",
                parentPSDETreeNodeId: "root",
                parentValueLevel: 1,
                searchMode: 3,
                navigateContext: {  },
                navigateParams: {  },
            }
    ]
}
export const model = getModel();
